package mrdemo013;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

import org.apache.hadoop.io.WritableComparable;

public class User implements WritableComparable<User>{
	
	private String userNo;
	
	private String userName;
	
	private String cityNo;
	
	private String cityName;
	
	public User(User user) {
		this.userNo = user.getUserNo();
		this.userName = user.getUserName();
		this.cityNo = user.getCityNo();
		this.cityName = user.getCityName();
	}

	public User(String userNo, String userName, String cityNo, String cityName) {
		super();
		this.userNo = userNo;
		this.userName = userName;
		this.cityNo = cityNo;
		this.cityName = cityName;
	}

	public User() {
		super();
	}

	@Override
	public void write(DataOutput out) throws IOException {
		out.writeUTF(userNo);
		out.writeUTF(userName);
		out.writeUTF(cityNo);
		out.writeUTF(cityName);
	}

	@Override
	public void readFields(DataInput in) throws IOException {
		this.userNo =  in.readUTF();
		this.userName = in.readUTF();
		this.cityNo = in.readUTF();
		this.cityName = in.readUTF();
	}

	@Override
	public int compareTo(User arg0) {
		return 0;
	}

	public String getUserNo() {
		return userNo;
	}

	public void setUserNo(String userNo) {
		this.userNo = userNo;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getCityNo() {
		return cityNo;
	}

	public void setCityNo(String cityNo) {
		this.cityNo = cityNo;
	}

	public String getCityName() {
		return cityName;
	}

	public void setCityName(String cityName) {
		this.cityName = cityName;
	}
	
	
}
